#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
    char a;
    while (scanf("%c", &a) != EOF) {
        getchar();
        if (a >= 'A' && a <= 'Z') {
            a += 32;
            printf("%c\n", a);
        }
        else if (a >= 'a' && a <= 'z') {
            a -= 32;
            printf("%c\n", a);
        }
    }
    return 0;
}